﻿using System;
using System.ComponentModel.DataAnnotations;
using System.Xml.Serialization;

namespace LD.Mes
{
    [Serializable]
    [XmlRoot("message")]
    public class LogoffRequest
    {
        /// <summary>
        ///Message Id() 
        /// </summary>
        [StringLength(100, ErrorMessage = "长度不能超过100个字符")]
        public string message_id { get; set; } = "LOGOFF_REQUEST";
        /// <summary>
        /// input/output
        /// </summary>
        [Required]
        public string type_id { get; set; } = "I";
        [Required(ErrorMessage = "system_byte不能为空")]
        public string system_byte
        {
            get
            {
                string time = DateTime.Now.ToString("yyyyMMddHHmmssfff");
                return $"{eqp_id}-{message_id}-{time}";
            }
            set { }
        }
        /// <summary>
        /// Panel ID
        /// </summary>
        [Required(ErrorMessage = "Panel ID不能为空")]
        public string glass_id { get; set; }
        /// <summary>
        /// 标签代码
        /// </summary>
        public string label_id { get; set; }
        /// <summary>
        ///产线代码 
        /// </summary>
        [Required(ErrorMessage = "产线代码不能为空")]
        public string line_id { get; set; }
        /// <summary>
        /// 设备代码
        /// </summary>
        [Required(ErrorMessage = "设备代码不能为空")]
        public string eqp_id { get; set; }
        /// <summary>
        /// 操作员
        /// </summary>
        [Required(ErrorMessage = "操作人员代码不能为空")]
        public string operator_id { get; set; }
    }
}
